import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '@/pages/home.vue'
import about from '@/pages/about.vue'
import login from '@/pages/login.vue'
import list from '@/pages/list.vue'
import search from '@/pages/search.vue'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    component: home,
    meta: {
      title: '首页',
    },
  },
  {
    path: '/about',
    component: about,
    meta: {
      title: '关于',
    },
  },
  {
    path: '/login',
    component: login,
    meta: {
      title: '登录',
    },
  },
  {
    path: '/list',
    component: list,
    meta: {
      title: '列表',
    },
  },
  {
    path: '/search',
    component: search,
    meta: {
      title: '搜索',
    },
  },
]

export function createRouter() {
  return new VueRouter({
    routes,
    mode: 'history',
  })
}
